namespace Digitalmes.Domain.Sys;

/// <summary>
/// 组织机构表
/// </summary>
[SugarTable("sys_organize", "组织机构表")]
public class SysOrganize : EntityTenantBase, IDeletedFilter
{
    /// <summary>
    /// 父节点
    /// </summary>
    [SugarColumn(ColumnDescription = "父节点")]
    public long ParentId { get; set; }

    /// <summary>
    /// 部门名称
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "部门名称", Length = 32)]
    public string? Name { get; set; }

    /// <summary>
    /// 机构编码
    /// </summary>
    [SugarColumn(ColumnDescription = "机构编码", Length = 32)]
    public string? Number { get; set; }

    /// <summary>
    /// 父节点集合
    /// </summary>
    [SugarColumn(ColumnDescription = "父节点集合", IsJson = true, Length = 512)]
    public List<long>? ParentIdList { get; set; }

    /// <summary>
    /// 部门层级
    /// </summary>
    [SugarColumn(ColumnDescription = "部门层级")]
    public int Layer { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    [SugarColumn(ColumnDescription = "排序")]
    public int Sort { get; set; } = 1;

    /// <summary>
    /// 状态
    /// </summary>
    [SugarColumn(ColumnDescription = "状态")]
    public bool Status { get; set; } = true;

    /// <summary>
    /// 是否删除
    /// </summary>
    [SugarColumn(ColumnDescription = "是否删除")]
    public bool IsDel { get; set; }

    /// <summary>
    /// 部门负责人
    /// </summary>
    [SugarColumn(ColumnDescription = "部门负责人", Length = 32)]
    public string? LeaderUser { get; set; }

    /// <summary>
    /// 联系电话
    /// </summary>
    [SugarColumn(ColumnDescription = "联系电话", Length = 32)]
    public string? LeaderMobile { get; set; }

    /// <summary>
    /// 联系邮箱
    /// </summary>
    [SugarColumn(ColumnDescription = "联系邮箱", Length = 32)]
    public string? LeaderEmail { get; set; }
}
